﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Knowledgecast.Twitter
{
    public class Status
    {
        public DateTime CreatedAt { get; set; }
        public string ID { get; set; }
        public string Text { get; set; }
        public string Source { get; set; }
        public bool Truncated { get; set; }
        public string InReplyToStatus { get; set; }
        public string InReplyToUser { get; set; }
        public bool Favourited { get; set; }
        public string InReplyToScreenName { get; set; }

        public TwitterUser User { get; set; }

        public override string ToString()
        {
            string convertedValue = string.Empty;
            Status status = this;
            if (status != null)
            {
                convertedValue += status.User.ScreenName + ", ";
                convertedValue += status.CreatedAt.ToLongDateString() + " " + status.CreatedAt.ToShortTimeString() + " via ";
                convertedValue += status.Source;
                if (String.IsNullOrEmpty(status.InReplyToScreenName) == false)
                {
                    convertedValue += " in reply to " + status.InReplyToScreenName;
                }
            }

            return convertedValue;
        }
    }
}
